Skip to content

Add retrieval context renderers - #697

Closed
ivarunchaudhary wants to merge 1 commit into
hydra-db:mainfrom
ivarunchaudhary:feat/670-context-renderers
Closed

ivarunchaudhary wants to merge 1 commit into
hydra-db:mainfrom
ivarunchaudhary:feat/670-context-renderers

Conversation

@ivarunchaudhary

@ivarunchaudhary ivarunchaudhary commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add compact, Markdown, JSON, and custom retrieval context renderers in Python and TypeScript.
Expose trust labels on structured records and preserve the default prompt output.

Implementation details

Decisions

Reuse the prompt renderer's record selection, ranking, and citation numbering. Named formats are available through the SDKs, CLI, and MCP. SDK callers can pass a synchronous renderer that receives the retrieval result and its context records.

Validation

  • Ran Python retrieval and time-aware tests on Kuzu.
  • Ran TypeScript conformance against Python, including all alternate formats and a custom renderer.
  • Checked formatting, TypeScript types, and the repository precheck.

Limits

The token budget selects complete prompt records. Alternate renderings can add formatting overhead to those records.

Linked issue

Closes #670

AI Assistance

Model Effort
GPT-6 via Codex Not specified

Checklist

  • Implements an issue a maintainer has /approved.
  • Small and scoped to that issue.
  • New errors have a code and hint, the same on API, CLI, and MCP in both SDKs (see AGENTS.md).
  • Breaking changes described below, or none.

Breaking changes

None.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@arrry-hydraDB

Copy link
Copy Markdown
Collaborator

Closing since #702 landed for #670 with the renderers in their own module and a ContextData input for custom renderers. Thanks for taking this on, the format validation and the custom renderer support here line up closely with what shipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make retrieve context a renderer with named formats and labels as data

2 participants